package com.an.threadtest.procomu;

import java.util.Map;

/**
 * @author Administrator 测试生产者消费者
 */
public class Go {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		RequestContainer container = new RequestContainer(10);

		new ProduceRequestThread(container, "生产者A").start();
		new ProduceRequestThread(container, "生产者B").start();
		new ProduceRequestThread(container, "生产者C").start();

		new ProcessRequestThread(container, "消费者1").start();
		new ProcessRequestThread(container, "消费者2").start();
		new ProcessRequestThread(container, "消费者3").start();
		new ProcessRequestThread(container, "消费者4").start();
		new ProcessRequestThread(container, "消费者5").start();
		new ProcessRequestThread(container, "消费者6").start();
		new ProcessRequestThread(container, "消费者7").start();

		Map<Thread, StackTraceElement[]> map = Thread.getAllStackTraces();
		for (Thread thread : map.keySet()) {
			System.out.println("xiancheng 线程的名称：" + thread.getName());
		}

	}

}
